#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os


class Settings:
    _root = os.path.abspath(os.path.dirname(__file__))

    # 服务器监听端口
    SERVER_LISTENING_PORT = 20000
    # 客户端连接超时时间
    CLIENT_SETUP_TIMEOUT = 300
    # 客户端最大数目
    CLIENT_MAX_NUM = 50
    # 数据存储方式
    SAVER_LIST = [
        "ConsoleSaver",
        # "CSVSaver",
        # "InfluxSaver",
    ]

    # CSV文件目录
    CSV_DIR = os.path.join(_root, "CSV")
    # InfluxDB 连接配置
    INFLUXDB_HOST = "localhost"
    INFLUXDB_PORT = 8086
    INFLUXDB_USER = ""
    INFLUXDB_PASS = ""
    INFLUXDB_DATABASE = "test"
    INFLUXDB_MEASUREMENT = "performanceStats"

    if "CSVSaver" in SAVER_LIST:
        if not os.path.exists(CSV_DIR):
            os.mkdir(CSV_DIR)
